import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  //auth是否需要登陆后才可以展示，默认为false
  //keepAlive 是否缓存当前页
  {
    path: '/',
    name: 'home',
    component: () => import('../views/Home.vue'),
    meta: { title: '首页', keepAlive: false, meta: true,auth:true }
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login.vue'),
    meta: { title: '登录', keepAlive: true, meta: false }
  },
  {
    path: '/my',
    name: 'my',
    component: () => import('../views/my/index.vue'),
    meta: { title: '我的', keepAlive: true, meta: true }
  },
  {
    path: '/process',
    name: 'process',
    component: () => import('../views/process/index.vue'),
    meta: { title: '办理进度', keepAlive: true, meta: true },
    // children:[
    // {
    //   path: '/process',
    //   name: 'process',
    //   component: () => import('../views/process/index.vue'),
    //   meta: { title: '办理进度', keepAlive: false },
    // }
    // ]
  },
  {
    path: '/contract',
    name: 'contract',
    component: () => import('../views/contract/contract.vue'),
    meta: { title: '周转房续租', keepAlive: true, meta: false }
  },
  {
    path: '/selectHouse',
    name: 'selectHouse',
    component: () => import('../views/news/selectHouse.vue'),
    meta: { title: '周转房续租', keepAlive: false, meta: false }
  },
  {
    path: '/news',
    name: 'news',
    component: () => import('../views/news/index.vue'),
    meta: { title: '周转房续租', keepAlive: false, meta: false }
  },
  {
    path: '/backRent',
    name: 'backRent',
    component: () => import('../views/news/backRent.vue'),
    meta: { title: '周转房退租', keepAlive: false, meta: false }
  },
  {
    path: '/applyHouse',
    name: 'applyHouse',
    component: () => import('../views/news/applyHouse.vue'),
    meta: { title: '周转房申请', keepAlive: false, meta: false }
  },
]

const router = new VueRouter({
  routes,
  scrollBehavior: () => ({ y: 0 })
})

export default router
